#ifndef LCD
#define	LCD

// *****************************************************************************
// CHANGE LOG
//
// *****************************************************************************

// *****************************************************************************
// *****************************************************************************
// Section: Includes
// *****************************************************************************
// *****************************************************************************

// *****************************************************************************
// *****************************************************************************
// Section: Constants & Data Types
// *****************************************************************************
// *****************************************************************************

/*! \brief Allows writing to an LCD device
 */
class Lcd
{
public:
/*! \brief Lcd Commands
*/
	enum class Commands
	{
		// Display Clear
		DisplayClear		= 1,  /*!< 0000 0001 : Display Clear */

		// Display/Cursor Home
		CursorHome		= 2,   /*!< 0000 0010 : Cursor Home */
		
		// Entry Mode Set. Must be OR'd together
		Increment			= 6,   /*!< 0000 0110 : I/D = 1 */
		Decrement			= 4,   /*!< 0000 0100 : I/D = 0 */
		DisplayShiftOn		= 5,   /*!< 0000 0101 : S = 1 */
		DisplayShiftOff	= 4,   /*!< 0000 0100 : S = 0 */

		// Display ON/OFF. Must be OR'd together
		DisplayOn			= 12,  /*!< 0000 1100 : D = 1 */
		DisplayOff		= 8,   /*!< 0000 1000 : D = 0 */
		CursorDisplayOn	= 10,  /*!< 0000 1010 : C = 1 */
		CusorDisplayOff	= 8,   /*!< 0000 1000 : C = 0 */
		CursorBlinkOn		= 9,   /*!< 0000 1001 : B = 1 */
		CursorBlinkOff		= 8,   /*!< 0000 1000 : B = 0 */

		// Display/Cursor Shift
		ShiftDisplay		= 24,  /*!< 0001 1000 : S/C = 1 */
		MoveCursor		= 16,  /*!< 0001 0000 : S/C = 0 */
		ShiftRight		= 20,  /*!< 0001 0100 : R/L = 1 */
		ShiftLeft			= 16,  /*!< 0001 0000 : R/L = 0 */

		// Function Set
		DataLength8Bit		= 48,  /*!< 0011 0000: DL = 1 */
		DataLength4Bit		= 32,  /*!< 0010 0000 : DL = 0 */
		DualLine			= 40,  /*!< 0010 1000 : N = 1 */
		SingleLine		= 32,  /*!< 0010 0000 : N = 0 */
		Font5x10			= 36,  /*!< 0010 0100 : F = 1 */
		Font5x8			= 16,  /*!< 0010 0000 : F = 0 */
	};

	static void Initialize();
	
	Lcd();
	virtual ~Lcd();

	void Write(const char *data);
	void Write(const char *data, unsigned char line);
	static void WriteCommand(unsigned char command);
	static void Write(unsigned char data);
	
	void Clear();
private:
	
};

#endif	/* LCD_H */

